package vip.liux.contracts.infrastructure.automap;

import org.mapstruct.Named;

import java.time.LocalDateTime;
import java.util.Optional;

public class MapMapper {
    public String mapString(Optional<String> value) {
        return value.orElse(null);
    }

    public LocalDateTime mapLocalDateTime(Optional<LocalDateTime> value) {
        return value.orElse(null);
    }

    @Named("ordinal")
    public int ordinal(Enum<?> state) {
        return state.ordinal();
    }
}
